<template>
	<view @touchmove.stop.prevent="()=>{}" v-if="showOver">
		<u-overlay :show="showOver" >
			<view class="">
				<view
					style="position: absolute;right: 100rpx;top:300rpx;border-radius: 50%;border: 1rpx solid #FFF; z-index: 20000;"
					@click="showOver = false">
					<u-icon name="close" size="50rpx" color="#ffffff" />
				</view>
				<view class="" v-if="!luck"
					style="display: flex;justify-content: center;align-items: center;height: 100vh;width: 100vw;">

					<view style="width: 90%;">
						<u-swiper :list="list" keyName="image" previousMargin="30" nextMargin="30" circular
							:autoplay="false" radius="5" bgColor="transparent" height="340" @click.stop='goPath'>
						</u-swiper>
					</view>
				</view>
				<view class="" v-else
					style="display: flex;justify-content: center;align-items: center;height: 100vh;width: 100vw;">
					<image :src="obj.image" style="width:90%;" mode="widthFix" @click.stop="gonav(obj.path)">
					</image>
				</view>
			</view>
		</u-overlay>

	</view>
</template>

<script>
	import {
		goNav
	} from '@/lib/Comment.js'
	export default {
		props: {
			list: {
				type: Array,
				default: () => {
					return []
				}
			},
			obj: {
				type: Object,
				default: () => {
					return {}
				}
			},
			luck: {
				type: Boolean,
				default:false
			},

		},
		data() {
			return {
				showOver: false
			}

		},
		created() {
			console.log("zhuj", this.list, this.isindex);
		},
		methods: {
			gonav(path) {
				console.log('url',path);
				goNav(path)
			},
			goPath(index) {
				console.log(index);
				if (this.list[index].appid) {
					uni.navigateToMiniProgram({
						appId: this.list[index].appid,
						path: this.list[index].path,
						//envVersion: 'release'
					})
					
				} else { 
					goNav(this.list[index].path)
				}
			},
			show() {
				this.showOver = true
			}
		}
	}
</script>

<style>
</style>
